package print

import (
	"github.com/fatih/color"
	"github.com/spf13/cobra"
)

// 打印绿色消息的命令
var greenCmd = &cobra.Command{
	Use:   "green",
	Short: "打印绿色的消息",
	Long:  "通过该命令，可以在终端输出绿色的消息",
	Run: func(cmd *cobra.Command, args []string) {
		count := len(args)
		color.Green("传入了%d个参数", count)
		for i, v := range args {
			color.Green("第%d个：%s", i+1, v)
		}
	},
}

func init() {
	RootPrintCmd.AddCommand(greenCmd)
}